package com.thread.exe;

import java.math.BigInteger;
import java.util.Arrays;

public class OneValueCache {
	private final BigInteger lastNumber;
	private final BigInteger[] lastFactors;
	
	public OneValueCache(BigInteger lastNumber, BigInteger[] lastFactors) {
		super();
		this.lastNumber = lastNumber;
		this.lastFactors = Arrays.copyOf(lastFactors, lastFactors.length);
	}
	
	public BigInteger[] getFactors(BigInteger i) {
		if(lastNumber == null || !lastNumber.equals(i))
			return null;
		else
			return Arrays.copyOf(lastFactors, lastFactors.length);
	}
	
	public Holder holder;
	
	public void initialize() {
		holder = new Holder(42);
	}
}
